package com.ysd.lis.controller;

import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.entity.WkQualityDetailAnnex;
import com.ysd.lis.service.WkQualityDetailAnnexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 质量控制计划明细表 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-05-08
 */
@RestController
@RequestMapping("/wk/quality/detail/annex")
public class WkQualityDetailAnnexController {

    @Autowired
    WkQualityDetailAnnexService wkQualityDetailAnnexService;

    @GetMapping("/getQualityDetailAnnexList")
    public Result getQualityDetailAnnexList(@RequestParam("detailId") String detailId, @RequestParam(value = "orgId", required = false) String orgId) {
        return wkQualityDetailAnnexService.getQualityDetailAnnexList(detailId, orgId);
    }

    @PostMapping("/addQualityDetailAnnex")
    @LogDetail(requestParam ="addQualityDetailAnnex",operationType = OperationType.INSERT, module = "质量控制计划明细",content = "增加质量控制明细【fileName】附件", businessName = "fileName")
    public Result addQualityDetailAnnex(@RequestBody WkQualityDetailAnnex wkQualityDetailAnnex) {
        return wkQualityDetailAnnexService.addQualityDetailAnnex(wkQualityDetailAnnex);
    }

    @PostMapping("/deleteQualityDetailAnnex")
    @LogDetail(requestParam ="deleteQualityDetailAnnex",operationType = OperationType.DELETE, module = "质量控制计划明细",content = "删除质量控制明细【ids】附件", businessName = "ids")
    public Result deleteQualityDetailAnnex(@RequestBody List<String> ids) {
        return wkQualityDetailAnnexService.deleteQualityDetailAnnex(ids);
    }
}

